#ifndef __USART_H
#define __USART_H

#include <stdio.h>
#include <stdbool.h>

#include "public.h"


#define TTY_RXBUF_SIZE      256
#define TTY_TXBUF_SIZE      1024

typedef struct 
{
    void (*init)(int baudrate);
    unsigned int (*write)(const void *buf, unsigned int len);
    unsigned int (*read)(void *buf, unsigned int len);
    bool (*tx_isfull)(void);
    bool (*tx_isempty)(void);
    bool (*rx_isempty)(void);
}tty_t;

extern const tty_t tty;

//如果想串口中断接收，请不要注释以下宏定义
void uart_init(int bound);

#endif


